import request from '@/utils/request';

/** 助理相关-start */
// 新建助理
export function assistantCreateApi(data) {
  return request({
    url: '/ai/dataset/assistant/create',
    method: 'post',
    data: data
  });
}

// 读取助理列表
export function assistantListApi(query) {
  return request({
    url: '/ai/dataset/assistant/list',
    method: 'get',
    params: query
  });
}

// 更新助理
export function assistantUpdateApi(data) {
  return request({
    url: '/ai/dataset/assistant/update',
    method: 'put',
    data: data
  });
}

// 删除助理
export function assistantRemoveApi(assistantIds) {
  return request({
    url: `/ai/dataset/assistant/remove/${assistantIds}`,
    method: 'delete'
  });
}

// 知识库下拉列表
export function datasetListApi(query) {
  return request({
    url: '/ai/dataset/list',
    method: 'get',
    params: query
  });
}
/** 助理相关-end */

/** 会话相关-start */
// 助理会话列表
export function sessionListApi(query) {
  return request({
    url: '/ai/dataset/session/list',
    method: 'get',
    params: query
  });
}

// 创建助理会话
export function sessionCreateApi(data) {
  return request({
    url: '/ai/dataset/session/create',
    method: 'post',
    data: data
  });
}

// 更新助理会话
export function sessionUpdateApi(data) {
  return request({
    url: '/ai/dataset/session/update',
    method: 'post',
    data: data
  });
}

// 删除助理会话
export function sessionRemoveApi(data) {
  return request({
    url: '/ai/dataset/session/remove',
    method: 'delete',
    data: data
  });
}

// 与聊天助手交谈
export function chartsCompletionsApi(data) {
  return request({
    url: '/ai/dataset/session/charts/completions',
    method: 'post',
    data: data
  });
}

/** 会话相关-end */
